<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="IE=edge">
    <title>建立分组</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../static/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../static/css/style.css">
    <link rel="stylesheet" href="../static/plugins/angularjs/toaster.min.css">

    <script type="text/javascript" src="../static/plugins/angularjs/angular.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/angular-animate.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/toaster.min.js"></script>

    <style type="text/css">
  table
  {
    margin-top:0px;
    padding-top:0px;
    text-align: center;
    width:50%;
  }
  td
  {
    padding:20px;
  }
</style>
<style>
  .basic{
    float:left;
    margin-left: 270px;
    font-size: 20px;
  }
</style>
<style>
  .tab{
    padding-right: 200px;
    text-align: left;
  }
</style>
<script type="text/javascript">
    var app = angular.module("TbFollowVO",[]);
    app.controller("TbFollowVOController",function ($scope,$http) {
        $scope.model = {
            "hospitalId":"",
            "hospitalName":"",
            "departmentId":"",
            "departmentName":"",
            "levelId":"",
            "levelName":"",
            "followId":"",
            "followName":"",
            "groupId":"",
            "groupClass":"",
            "principal":"",
            "phone":"",
            "startTime":"",
            "endTime":"",
            "state":"",
            "classNumber":"",
            "patientAmount":"",
            "backGround":""
        }
        $scope.addFollow = function () {
            $http({
                url:"addFollow",
                method:"post",
                data:$scope.model,
                headers:{ 'Content-Type': 'application/x-www-form-urlencoded' },
                transformRequest:function (obj) {
                    var str = [];
                    for (var p in obj) {
                        str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                    }
                    alert("添加成功");
                    return str.join("&");
                }
            }).success(function (data) {
                history.go(0);
            })
        }
    });
    $(function () {
        $.ajax({
            url:'selectHospital',
            type:"post",
            dataType:"json",
            //成功返回数据集合List
            success:function (list) {
                //定义空字符串
                var s = '';
                //遍历循环数组中的数据
                for (var i=0;i<list.length;i++){
                    //拼接<option value="list[i].departmentId">"+list[i].departmentName+"</option>
                    s+="<option value = '"+list[i].hospitalId+"'>"+list[i].hospitalName+"</option>"
                }
                //拼接s
                $("#hospitalId").append(s);
            }
        })
    })
    $(function () {
        $.ajax({
            url:'selectDepartment',
            type:"post",
            dataType:"json",
            //成功返回数据集合List
            success:function (list) {
                //定义空字符串
                var s = '';
                //遍历循环数组中的数据
                for (var i=0;i<list.length;i++){
                    //拼接<option value="list[i].departmentId">"+list[i].departmentName+"</option>
                    s+="<option value = '"+list[i].departmentId+"'>"+list[i].departmentName+"</option>"
                }
                //拼接s
                $("#departmentId").append(s);
            }
        })
    })
    $(function () {
        $.ajax({
            url:"selectLevel",
            type:"post",
            dataType:"json",
            success:function (list) {
                var s = "";
                for(var i = 0;i<list.length;i++){
                    s+="<option value='"+list[i].levelId+"'>"+list[i].levelName+"</option>"
                }
                $("#levelId").append(s);
            }
        })
    })
    $(function () {
        $.ajax({
            url:"selectGroup",
            type:"post",
            dataType:"json",
            success:function (list) {
                var s = "";
                for(var i=0;i<list.length;i++){
                    s+="<option value='"+list[i].groupId+"'>"+list[i].groupClass+"</option>"
                }
                $("#groupId").append(s);
            }
        })
    })
</script>
</head>
<body class="hold-transition skin-red sidebar-mini" ng-app="drugsCatalog" ng-controller="drugCheckController" ng-init="pages()">
<toaster-container toaster-options="{'time-out': 1000,'position-class':'toast-top-center'}"></toaster-container>
<table border="1" cellspacing="1"style="width: 100%;height:100%;">
  <tr>
      <div class="left" style="text-align: left;">
        <p><a href="GroupManagement">返回随访组:</a></p>
      </div>
    <td style="background: white" align="center" height=650px; width="800px">
      <div class="modal-body" >
        <div style="text-align: center;background: #ffff">
          <table class="tab">
            <tr class="col-md-6">
              <td>责任医院:<select padding-center; ng-model="model.hospitalId" id="hospitalId" class="form-control"style="width: 160px;height: 25px;">
               <option value="0"></option>
              </select>
              </td>
              <td>责任科室:<select padding-center; ng-model="model.departmentId" id="departmentId" class="form-control"style="width: 160px;height: 25px;">
                <option value="0"></option>
              </select>
              </td>
            </tr>
              <tr class="col-md-6">
                  <td>负责人:<input padding-center; ng-model="model.principal"style="width: 165px;height: 22px;"></td>
                  <td>级别:<select padding-center; ng-model="model.levelId" id="levelId" class="form-control"style="width: 160px;height: 25px;">
                      <option value="0"></option>
                  </select>
                  </td>
              </tr>
            <tr class="col-md-6">
              <td>名称:<input padding-center; ng-model="model.followName"style="width: 165px;height: 22px;"></td>
              <td>联系电话:<input padding-center; ng-model="model.phone"style="width: 165px;height: 22px;"></td>
              </td>
              <td>开始日期:<label for="meeting"><input padding-center; ng-model="model.startTime"id="meeting" type="date" style="width: 160px;height: 22px" /></label></td>
              <td>结束日期:<label for="meeting2"><input padding-center; ng-model="model.endTime"id="meeting2" type="date" style="width: 160px;height: 22px" /></label></td>
              </td>
            </tr>
          </table>
        </div>
        <div style="text-align: center;background: #ffff">
          <table class="tab">
            <tr class="col-md-6">
                <td>状态:<select padding-center; ng-model="model.state" class="form-control"style="width: 160px;height: 25px;">
                    <option value="1">开放</option>
                    <option value="2">关闭</option>
                </select>
                </td>
                <td>课题编号:<input padding-center; ng-model="model.classNumber"style="width: 165px;height: 22px;"></td>
                <td>患者数量:<input padding-center; ng-model="model.patientAmount"style="width: 165px;height: 22px;"></td>
                <td>小组类别:<select padding-center; ng-model="model.groupId" id="groupId" style="width: 165px;height: 22px;">
                    <option value="0"></option>
                </select>
                </td>
            </tr>
          </table>
        </div>
        <div style="text-align: center;background: #ffff">
          <table class="tab">
            <tr class="col-md-6">
                <td>背景:<input padding-center; ng-model="model.background"style="width: 810px;height: 66px;"></td>
            </tr>
          </table>
        </div>
      </div>
        <div style="text-align: center;padding-top: 10px;">
          <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">保存</button>
        </div>
      </div>
      </div>
    </td>
  </tr>
</table>
</body>
</html>
